home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / drivers / sf1.c < prev    next >
C/C++ Source or Header  |  2000-05-06  |  44KB  |  1,211 lines

  1. /***************************************************************************
  2.  
  3.   Street Fighter 1
  4.  
  5.   driver by Olivier Galibert
  6.  
  7. ***************************************************************************/
  8.  
  9. #include "driver.h"
  10. #include "cpuintrf.h"
  11. #include "vidhrdw/generic.h"
  12. #include "cpu/z80/z80.h"
  13. #include "cpu/m68000/m68000.h"
  14.  
  15.  
  16. extern unsigned char *sf1_objectram;
  17. extern int sf1_deltaxb;
  18. extern int sf1_deltaxm;
  19. extern int sf1_active;
  20.  
  21. static unsigned char *sharedram;
  22.  
  23. int sf1_vh_start(void);
  24. void sf1_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh);
  25. WRITE_HANDLER( sf1_deltaxb_w );
  26. WRITE_HANDLER( sf1_deltaxm_w );
  27. WRITE_HANDLER( sf1_videoram_w );
  28. void sf1_active_w(int data);
  29.  
  30.  
  31. static READ_HANDLER( dummy_r )
  32. {
  33.     return 0xffff;
  34. }
  35.  
  36. /* b0 = reset, or maybe "set anyway" */
  37. /* b1 = pulsed when control6.b6==0 until it's 1 */
  38. /* b2 = active when dip 8 (flip) on */
  39. /* b3 = active character plane */
  40. /* b4 = unused */
  41. /* b5 = active background plane */
  42. /* b6 = active middle plane */
  43. /* b7 = active sprites */
  44. static WRITE_HANDLER( active_w )
  45. {
  46.     if((data&0xff)!=0)
  47.         sf1_active_w(data);
  48. }
  49.  
  50.  
  51. static WRITE_HANDLER( soundcmd_w )
  52. {
  53.     if (data != 0xffff) {
  54.         soundlatch_w(offset,data);
  55.         cpu_cause_interrupt(1,Z80_NMI_INT);
  56.     }
  57. }
  58.  
  59. /* Idle cycles skipping */
  60. static WRITE_HANDLER( shared_w )
  61. {
  62.     COMBINE_WORD_MEM (sharedram+offset, data);
  63.  
  64.     if (offset)
  65.         return;
  66.     switch(cpu_get_pc()) {
  67.     case 0x3b1a6:
  68.     case 0x3b1a2:
  69.     case 0x3a1d6:
  70.         if(!(cpu_get_reg(M68K_SR) & 0x0700)) {
  71.             int i;
  72.             unsigned char *adr = sharedram+6;
  73.             for(i=0;i<16;i++) {
  74.                 if(READ_WORD(adr) & 0x0300)
  75.                     return;
  76.                 adr += 16;
  77.             }
  78.             cpu_spinuntil_int();
  79.         }
  80.         break;
  81.     }
  82. }
  83.  
  84. /* The protection of the japanese version */
  85. /* I'd love to see someone dump the 68705 rom */
  86.  
  87. static WRITE_HANDLER( protection_w )
  88. {
  89.     static int maplist[4][10] = {
  90.         { 1, 0, 3, 2, 4, 5, 6, 7, 8, 9 },
  91.         { 4, 5, 6, 7, 1, 0, 3, 2, 8, 9 },
  92.         { 3, 2, 1, 0, 6, 7, 4, 5, 8, 9 },
  93.         { 6, 7, 4, 5, 3, 2, 1, 0, 8, 9 }
  94.     };
  95.     int map;
  96.  
  97.     map = maplist
  98.         [cpu_readmem24bew(0xffc006)]
  99.         [(cpu_readmem24bew(0xffc003)<<1) + (cpu_readmem24bew_word(0xffc004)>>8)];
  100.  
  101.     switch(cpu_readmem24bew(0xffc684)) {
  102.     case 1:
  103.         {
  104.             int base;
  105.  
  106.             base = 0x1b6e8+0x300e*map;
  107.  
  108.             cpu_writemem24bew_dword(0xffc01c, 0x16bfc+0x270*map);
  109.             cpu_writemem24bew_dword(0xffc020, base+0x80);
  110.             cpu_writemem24bew_dword(0xffc024, base);
  111.             cpu_writemem24bew_dword(0xffc028, base+0x86);
  112.             cpu_writemem24bew_dword(0xffc02c, base+0x8e);
  113.             cpu_writemem24bew_dword(0xffc030, base+0x20e);
  114.             cpu_writemem24bew_dword(0xffc034, base+0x30e);
  115.             cpu_writemem24bew_dword(0xffc038, base+0x38e);
  116.             cpu_writemem24bew_dword(0xffc03c, base+0x40e);
  117.             cpu_writemem24bew_dword(0xffc040, base+0x80e);
  118.             cpu_writemem24bew_dword(0xffc044, base+0xc0e);
  119.             cpu_writemem24bew_dword(0xffc048, base+0x180e);
  120.             cpu_writemem24bew_dword(0xffc04c, base+0x240e);
  121.             cpu_writemem24bew_dword(0xffc050, 0x19548+0x60*map);
  122.             cpu_writemem24bew_dword(0xffc054, 0x19578+0x60*map);
  123.             break;
  124.         }
  125.     case 2:
  126.         {
  127.             static int delta1[10] = {
  128.                 0x1f80, 0x1c80, 0x2700, 0x2400, 0x2b80, 0x2e80, 0x3300, 0x3600, 0x3a80, 0x3d80
  129.             };
  130.             static int delta2[10] = {
  131.                 0x2180, 0x1800, 0x3480, 0x2b00, 0x3e00, 0x4780, 0x5100, 0x5a80, 0x6400, 0x6d80
  132.             };
  133.  
  134.             int d1 = delta1[map] + 0xc0;
  135.             int d2 = delta2[map];
  136.  
  137.             cpu_writemem24bew_word(0xffc680, d1);
  138.             cpu_writemem24bew_word(0xffc682, d2);
  139.             cpu_writemem24bew_word(0xffc00c, 0xc0);
  140.             cpu_writemem24bew_word(0xffc00e, 0);
  141.  
  142.             sf1_deltaxm_w(0, d1);
  143.             sf1_deltaxb_w(0, d2);
  144.             break;
  145.         }
  146.     case 4:
  147.         {
  148.             int pos = cpu_readmem24bew(0xffc010);
  149.             pos = (pos+1) & 3;
  150.             cpu_writemem24bew(0xffc010, pos);
  151.             if(!pos) {
  152.                 int d1 = cpu_readmem24bew_word(0xffc682);
  153.                 int off = cpu_readmem24bew_word(0xffc00e);
  154.                 if(off!=512) {
  155.                     off++;
  156.                     d1++;
  157.                 } else {
  158.                     off = 0;
  159.                     d1 -= 512;
  160.                 }
  161.                 cpu_writemem24bew_word(0xffc682, d1);
  162.                 cpu_writemem24bew_word(0xffc00e, off);
  163.                 sf1_deltaxb_w(0, d1);
  164.             }
  165.             break;
  166.         }
  167.     default:
  168.         {
  169.             logerror("Write protection at %06x (%04x)\n", cpu_get_pc(), data&0xffff);
  170.             logerror("*** Unknown protection %d\n", cpu_readmem24bew(0xffc684));
  171.             break;
  172.         }
  173.     }
  174. }
  175.  
  176.  
  177. /* The world version has analog buttons */
  178. /* We simulate them with 3 buttons the same way the other versions
  179.    internally do */
  180.  
  181. static int scale[8] = { 0x00, 0x40, 0xe0, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe };
  182.  
  183. static READ_HANDLER( button1_r )
  184. {
  185.     return (scale[input_port_7_r(0)]<<8)|scale[input_port_5_r(0)];
  186. }
  187.  
  188. static READ_HANDLER( button2_r )
  189. {
  190.     return (scale[input_port_8_r(0)]<<8)|scale[input_port_6_r(0)];
  191. }
  192.  
  193.  
  194. static WRITE_HANDLER( sound2_bank_w )
  195. {
  196.     cpu_setbank(4, memory_region(REGION_CPU3)+0x8000*(data+1));
  197. }
  198.  
  199.  
  200. static WRITE_HANDLER( msm5205_w )
  201. {
  202.     MSM5205_reset_w(offset,(data>>7)&1);
  203.     /* ?? bit 6?? */
  204.     MSM5205_data_w(offset,data);
  205.     MSM5205_vclk_w(offset,1);
  206.     MSM5205_vclk_w(offset,0);
  207. }
  208.  
  209.  
  210.  
  211. static struct MemoryReadAddress readmem[] =
  212. {
  213.     { 0x000000, 0x04ffff, MRA_ROM },
  214.     { 0x800000, 0x800fff, MRA_BANK3 },
  215.     { 0xc00000, 0xc00001, input_port_3_r },
  216.     { 0xc00002, 0xc00003, input_port_4_r },
  217.     { 0xc00004, 0xc00005, button1_r },
  218.     { 0xc00006, 0xc00007, button2_r },
  219.     { 0xc00008, 0xc00009, input_port_0_r },
  220.     { 0xc0000a, 0xc0000b, input_port_1_r },
  221.     { 0xc0000c, 0xc0000d, input_port_2_r },
  222.     { 0xc0000e, 0xc0000f, dummy_r },
  223.     { 0xff8000, 0xff80ff, MRA_BANK5 },
  224.     { 0xff8100, 0xffdfff, MRA_BANK1 },
  225.     { 0xffe000, 0xffffff, MRA_BANK2 },
  226.     { -1 }
  227. };
  228.  
  229. static struct MemoryReadAddress readmemus[] =
  230. {
  231.     { 0x000000, 0x04ffff, MRA_ROM },
  232.     { 0x800000, 0x800fff, MRA_BANK3 },
  233.     { 0xc00000, 0xc00001, input_port_3_r },
  234.     { 0xc00002, 0xc00003, input_port_4_r },
  235.     { 0xc00004, 0xc00005, dummy_r },
  236.     { 0xc00006, 0xc00007, dummy_r },
  237.     { 0xc00008, 0xc00009, input_port_0_r },
  238.     { 0xc0000a, 0xc0000b, input_port_1_r },
  239.     { 0xc0000c, 0xc0000d, input_port_2_r },
  240.     { 0xc0000e, 0xc0000f, dummy_r },
  241.     { 0xff8000, 0xff80ff, MRA_BANK5 },
  242.     { 0xff8100, 0xffdfff, MRA_BANK1 },
  243.     { 0xffe000, 0xffffff, MRA_BANK2 },
  244.     { -1 }
  245. };
  246.  
  247. static struct MemoryReadAddress readmemjp[] =
  248. {
  249.     { 0x000000, 0x04ffff, MRA_ROM },
  250.     { 0x800000, 0x800fff, MRA_BANK3 },
  251.     { 0xc00000, 0xc00001, input_port_3_r },
  252.     { 0xc00002, 0xc00003, input_port_4_r },
  253.     { 0xc00004, 0xc00005, input_port_5_r },
  254.     { 0xc00006, 0xc00007, dummy_r },
  255.     { 0xc00008, 0xc00009, input_port_0_r },
  256.     { 0xc0000a, 0xc0000b, input_port_1_r },
  257.     { 0xc0000c, 0xc0000d, input_port_2_r },
  258.     { 0xc0000e, 0xc0000f, dummy_r },
  259.     { 0xff8000, 0xff80ff, MRA_BANK5 },
  260.     { 0xff8100, 0xffdfff, MRA_BANK1 },
  261.     { 0xffe000, 0xffffff, MRA_BANK2 },
  262.     { -1 }
  263. };
  264.  
  265. static struct MemoryWriteAddress writemem[] =
  266. {
  267.     { 0x000000, 0x04ffff, MWA_ROM },
  268.     { 0x800000, 0x800fff, sf1_videoram_w, &videoram, &videoram_size },
  269.     { 0xb00000, 0xb007ff, paletteram_xxxxRRRRGGGGBBBB_word_w, &paletteram },
  270.     { 0xc00010, 0xc00011, MWA_NOP }, /* Coin counters, etc... */
  271.     { 0xc00014, 0xc00015, sf1_deltaxm_w },
  272.     { 0xc00017, 0xc00018, sf1_deltaxb_w },
  273.     { 0xc0001a, 0xc0001b, active_w },
  274.     { 0xc0001c, 0xc0001d, soundcmd_w },
  275.     { 0xc0001e, 0xc0001f, protection_w },
  276.     { 0xff8000, 0xff80ff, shared_w, &sharedram },
  277.     { 0xff8100, 0xffdfff, MWA_BANK1 },
  278.     { 0xffe000, 0xffffff, MWA_BANK2, &sf1_objectram },
  279.     { -1 }
  280. };
  281.  
  282. static struct MemoryReadAddress sound_readmem[] =
  283. {
  284.     { 0x0000, 0x7fff, MRA_ROM },
  285.     { 0xc000, 0xc7ff, MRA_RAM },
  286.     { 0xc800, 0xc800, soundlatch_r },
  287.     { 0xe001, 0xe001, YM2151_status_port_0_r },
  288.     { -1 }
  289. };
  290.  
  291. static struct MemoryWriteAddress sound_writemem[] =
  292. {
  293.     { 0x0000, 0x7fff, MWA_ROM },
  294.     { 0xc000, 0xc7ff, MWA_RAM },
  295.     { 0xe000, 0xe000, YM2151_register_port_0_w },
  296.     { 0xe001, 0xe001, YM2151_data_port_0_w },
  297.     { -1 }
  298. };
  299.  
  300.  
  301. static struct MemoryReadAddress sound2_readmem[] =
  302. {
  303.     { 0x0000, 0x7fff, MRA_ROM },
  304.     { 0x8000, 0xffff, MRA_BANK4 },
  305.     { -1 }
  306. };
  307.  
  308. /* Yes, _no_ ram */
  309. static struct MemoryWriteAddress sound2_writemem[] =
  310. {
  311.     { 0x0000, 0xffff, MWA_ROM },
  312.     { -1 }
  313. };
  314.  
  315. static struct IOReadPort sound2_readport[] =
  316. {
  317.     { 0x01, 0x01, soundlatch_r },
  318.     { -1 }
  319. };
  320.  
  321.  
  322. static struct IOWritePort sound2_writeport[] =
  323. {
  324.     { 0x00, 0x01, msm5205_w },
  325.     { 0x02, 0x02, sound2_bank_w },
  326.     { -1 }
  327. };
  328.  
  329.  
  330. INPUT_PORTS_START( sf1jp )
  331.     PORT_START
  332.     PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_A ) )
  333.     PORT_DIPSETTING(      0x0000, DEF_STR( 4C_1C ) )
  334.     PORT_DIPSETTING(      0x0001, DEF_STR( 3C_1C ) )
  335.     PORT_DIPSETTING(      0x0002, DEF_STR( 2C_1C ) )
  336.     PORT_DIPSETTING(      0x0007, DEF_STR( 1C_1C ) )
  337.     PORT_DIPSETTING(      0x0006, DEF_STR( 1C_2C ) )
  338.     PORT_DIPSETTING(      0x0005, DEF_STR( 1C_3C ) )
  339.     PORT_DIPSETTING(      0x0004, DEF_STR( 1C_4C ) )
  340.     PORT_DIPSETTING(      0x0003, DEF_STR( 1C_6C ) )
  341.     PORT_DIPNAME( 0x0038, 0x0038, DEF_STR( Coin_B ) )
  342.     PORT_DIPSETTING(      0x0000, DEF_STR( 4C_1C ) )
  343.     PORT_DIPSETTING(      0x0008, DEF_STR( 3C_1C ) )
  344.     PORT_DIPSETTING(      0x0010, DEF_STR( 2C_1C ) )
  345.     PORT_DIPSETTING(      0x0038, DEF_STR( 1C_1C ) )
  346.     PORT_DIPSETTING(      0x0030, DEF_STR( 1C_2C ) )
  347.     PORT_DIPSETTING(      0x0028, DEF_STR( 1C_3C ) )
  348.     PORT_DIPSETTING(      0x0020, DEF_STR( 1C_4C ) )
  349.     PORT_DIPSETTING(      0x0018, DEF_STR( 1C_6C ) )
  350.     PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
  351.     PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
  352.     PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Flip_Screen ) )
  353.     PORT_DIPSETTING(      0x0100, DEF_STR( Off ) )
  354.     PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
  355.     PORT_DIPNAME( 0x0200, 0x0200, "Attract music" )
  356.     PORT_DIPSETTING(      0x0200, DEF_STR( Off ) )
  357.     PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
  358.     PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
  359.     PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
  360.     PORT_DIPNAME( 0x1000, 0x1000, "Speed" )
  361.     PORT_DIPSETTING(      0x0000, "Slow" )
  362.     PORT_DIPSETTING(      0x1000, "Normal" )
  363.     PORT_DIPNAME( 0x2000, 0x2000, "Attract sound?" )
  364.     PORT_DIPSETTING(      0x2000, DEF_STR( Off ) )
  365.     PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
  366.     PORT_DIPNAME( 0x4000, 0x4000, "Freeze" )
  367.     PORT_DIPSETTING(      0x4000, DEF_STR( Off ) )
  368.     PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
  369.     PORT_SERVICE( 0x8000, IP_ACTIVE_LOW )
  370.  
  371.     PORT_START
  372.     PORT_DIPNAME( 0x0007, 0x0007, "Continuation max stage" )
  373.     PORT_DIPSETTING(      0x0007, "5th" )
  374.     PORT_DIPSETTING(      0x0006, "4th" )
  375.     PORT_DIPSETTING(      0x0005, "3rd" )
  376.     PORT_DIPSETTING(      0x0004, "2nd" )
  377.     PORT_DIPSETTING(      0x0003, "1st" )
  378.     PORT_DIPSETTING(      0x0002, "No continuation" )
  379.     PORT_DIPNAME( 0x0018, 0x0018, "Round time" )
  380.     PORT_DIPSETTING(      0x0018, "100" )
  381.     PORT_DIPSETTING(      0x0010, "150" )
  382.     PORT_DIPSETTING(      0x0008, "200" )
  383.     PORT_DIPSETTING(      0x0000, "250" )
  384.     PORT_DIPNAME( 0x0060, 0x0060, DEF_STR( Difficulty ) )
  385.     PORT_DIPSETTING(      0x0060, "Normal" )
  386.     PORT_DIPSETTING(      0x0040, "Easy" )
  387.     PORT_DIPSETTING(      0x0020, "Difficult" )
  388.     PORT_DIPSETTING(      0x0000, "Very difficult" )
  389.     PORT_DIPNAME( 0x0380, 0x0380, "Buy-in max stage" )
  390.     PORT_DIPSETTING(      0x0380, "5th" )
  391.     PORT_DIPSETTING(      0x0300, "4th" )
  392.     PORT_DIPSETTING(      0x0280, "3rd" )
  393.     PORT_DIPSETTING(      0x0200, "2nd" )
  394.     PORT_DIPSETTING(      0x0180, "1st" )
  395.     PORT_DIPSETTING(      0x0080, "No buy-in" )
  396.     PORT_DIPNAME( 0x0400, 0x0000, "Number of start countries" )
  397.     PORT_DIPSETTING(      0x0000, "4" )
  398.     PORT_DIPSETTING(      0x0400, "2" )
  399.     PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
  400.     PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
  401.     PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
  402.     PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
  403.     PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
  404.  
  405.     PORT_START
  406.     PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START1 )
  407.     PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_START2 )
  408.     PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN3 )
  409.     PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN )
  410.     PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
  411.     PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
  412.     PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
  413.     PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* Freezes the game ? */
  414.     PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )
  415.     PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
  416.     PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
  417.     PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
  418.     PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
  419.     PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
  420.     PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
  421.     PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
  422.  
  423.     PORT_START
  424.     PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
  425.     PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
  426.     PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
  427.     PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN )
  428.     PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
  429.     PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
  430.     PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
  431.     PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
  432.     PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )
  433.     PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
  434.     PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
  435.     PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
  436.     PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
  437.     PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
  438.     PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
  439.     PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
  440.  
  441.  
  442.     PORT_START
  443.     PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER1 )
  444.     PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER1 )
  445.     PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER1 )
  446.     PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER1 )
  447.     PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
  448.     PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
  449.     PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
  450.     PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
  451.     PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER1 )
  452.     PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER1 )
  453.     PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON3 | IPF_PLAYER1 )
  454.     PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
  455.     PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON4 | IPF_PLAYER1 )
  456.     PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON5 | IPF_PLAYER1 )
  457.     PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON6 | IPF_PLAYER1 )
  458.     PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
  459.  
  460.     PORT_START
  461.     PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER2 )
  462.     PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER2 )
  463.     PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER2 )
  464.     PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER2 )
  465.     PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
  466.     PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
  467.     PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
  468.     PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
  469.     PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )
  470.     PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER2 )
  471.     PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON3 | IPF_PLAYER2 )
  472.     PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
  473.     PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON4 | IPF_PLAYER2 )
  474.     PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON5 | IPF_PLAYER2 )
  475.     PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON6 | IPF_PLAYER2 )
  476.     PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
  477. INPUT_PORTS_END
  478.  
  479. INPUT_PORTS_START( sf1us )
  480.     PORT_START
  481.     PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_A ) )
  482.     PORT_DIPSETTING(      0x0000, DEF_STR( 4C_1C ) )
  483.     PORT_DIPSETTING(      0x0001, DEF_STR( 3C_1C ) )
  484.     PORT_DIPSETTING(      0x0002, DEF_STR( 2C_1C ) )
  485.     PORT_DIPSETTING(      0x0007, DEF_STR( 1C_1C ) )
  486.     PORT_DIPSETTING(      0x0006, DEF_STR( 1C_2C ) )
  487.     PORT_DIPSETTING(      0x0005, DEF_STR( 1C_3C ) )
  488.     PORT_DIPSETTING(      0x0004, DEF_STR( 1C_4C ) )
  489.     PORT_DIPSETTING(      0x0003, DEF_STR( 1C_6C ) )
  490.     PORT_DIPNAME( 0x0038, 0x0038, DEF_STR( Coin_B ) )
  491.     PORT_DIPSETTING(      0x0000, DEF_STR( 4C_1C ) )
  492.     PORT_DIPSETTING(      0x0008, DEF_STR( 3C_1C ) )
  493.     PORT_DIPSETTING(      0x0010, DEF_STR( 2C_1C ) )
  494.     PORT_DIPSETTING(      0x0038, DEF_STR( 1C_1C ) )
  495.     PORT_DIPSETTING(      0x0030, DEF_STR( 1C_2C ) )
  496.     PORT_DIPSETTING(      0x0028, DEF_STR( 1C_3C ) )
  497.     PORT_DIPSETTING(      0x0020, DEF_STR( 1C_4C ) )
  498.     PORT_DIPSETTING(      0x0018, DEF_STR( 1C_6C ) )
  499.     PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
  500.     PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
  501.     PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Flip_Screen ) )
  502.     PORT_DIPSETTING(      0x0100, DEF_STR( Off ) )
  503.     PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
  504.     PORT_DIPNAME( 0x0200, 0x0200, "Attract music" )
  505.     PORT_DIPSETTING(      0x0200, DEF_STR( Off ) )
  506.     PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
  507.     PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
  508.     PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
  509.     PORT_DIPNAME( 0x1000, 0x1000, "Speed" )
  510.     PORT_DIPSETTING(      0x0000, "Slow" )
  511.     PORT_DIPSETTING(      0x1000, "Normal" )
  512.     PORT_DIPNAME( 0x2000, 0x2000, "Attract sound?" )
  513.     PORT_DIPSETTING(      0x2000, DEF_STR( Off ) )
  514.     PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
  515.     PORT_DIPNAME( 0x4000, 0x4000, "Freeze" )
  516.     PORT_DIPSETTING(      0x4000, DEF_STR( Off ) )
  517.     PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
  518.     PORT_SERVICE( 0x8000, IP_ACTIVE_LOW )
  519.  
  520.     PORT_START
  521.     PORT_DIPNAME( 0x0007, 0x0007, "Continuation max stage" )
  522.     PORT_DIPSETTING(      0x0007, "5th" )
  523.     PORT_DIPSETTING(      0x0006, "4th" )
  524.     PORT_DIPSETTING(      0x0005, "3rd" )
  525.     PORT_DIPSETTING(      0x0004, "2nd" )
  526.     PORT_DIPSETTING(      0x0003, "1st" )
  527.     PORT_DIPSETTING(      0x0002, "No continuation" )
  528.     PORT_DIPNAME( 0x0018, 0x0018, "Round time" )
  529.     PORT_DIPSETTING(      0x0018, "100" )
  530.     PORT_DIPSETTING(      0x0010, "150" )
  531.     PORT_DIPSETTING(      0x0008, "200" )
  532.     PORT_DIPSETTING(      0x0000, "250" )
  533.     PORT_DIPNAME( 0x0060, 0x0060, DEF_STR( Difficulty ) )
  534.     PORT_DIPSETTING(      0x0060, "Normal" )
  535.     PORT_DIPSETTING(      0x0040, "Easy" )
  536.     PORT_DIPSETTING(      0x0020, "Difficult" )
  537.     PORT_DIPSETTING(      0x0000, "Very difficult" )
  538.     PORT_DIPNAME( 0x0380, 0x0380, "Buy-in max stage" )
  539.     PORT_DIPSETTING(      0x0380, "5th" )
  540.     PORT_DIPSETTING(      0x0300, "4th" )
  541.     PORT_DIPSETTING(      0x0280, "3rd" )
  542.     PORT_DIPSETTING(      0x0200, "2nd" )
  543.     PORT_DIPSETTING(      0x0180, "1st" )
  544.     PORT_DIPSETTING(      0x0080, "No buy-in" )
  545.     PORT_DIPNAME( 0x0400, 0x0000, "Number of start countries" )
  546.     PORT_DIPSETTING(      0x0000, "4" )
  547.     PORT_DIPSETTING(      0x0400, "2" )
  548.     PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
  549.     PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
  550.     PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
  551.     PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
  552.     PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
  553.  
  554.     PORT_START
  555.     PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START1 )
  556.     PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_START2 )
  557.     PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN3 )
  558.     PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN )
  559.     PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
  560.     PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
  561.     PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
  562.     PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* Freezes the game ? */
  563.     PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )
  564.     PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
  565.     PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
  566.     PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
  567.     PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
  568.     PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
  569.     PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
  570.     PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
  571.  
  572.     PORT_START
  573.     PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
  574.     PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
  575.     PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON6 | IPF_PLAYER1 )
  576.     PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN )
  577.     PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
  578.     PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
  579.     PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
  580.     PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
  581.     PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON6 | IPF_PLAYER2 )
  582.     PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON3 | IPF_PLAYER1 )
  583.     PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON3 | IPF_PLAYER2 )
  584.     PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
  585.     PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
  586.     PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
  587.     PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
  588.     PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
  589.  
  590.     PORT_START
  591.     PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER1 )
  592.     PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER1 )
  593.     PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER1 )
  594.     PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER1 )
  595.     PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER1 )
  596.     PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER1 )
  597.     PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON4 | IPF_PLAYER1 )
  598.     PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON5 | IPF_PLAYER1 )
  599.     PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER2 )
  600.     PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER2 )
  601.     PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER2 )
  602.     PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER2 )
  603.     PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )
  604.     PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER2 )
  605.     PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON4 | IPF_PLAYER2 )
  606.     PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON5 | IPF_PLAYER2 )
  607. INPUT_PORTS_END
  608.  
  609. INPUT_PORTS_START( sf1 )
  610.     PORT_START
  611.     PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_A ) )
  612.     PORT_DIPSETTING(      0x0000, DEF_STR( 4C_1C ) )
  613.     PORT_DIPSETTING(      0x0001, DEF_STR( 3C_1C ) )
  614.     PORT_DIPSETTING(      0x0002, DEF_STR( 2C_1C ) )
  615.     PORT_DIPSETTING(      0x0007, DEF_STR( 1C_1C ) )
  616.     PORT_DIPSETTING(      0x0006, DEF_STR( 1C_2C ) )
  617.     PORT_DIPSETTING(      0x0005, DEF_STR( 1C_3C ) )
  618.     PORT_DIPSETTING(      0x0004, DEF_STR( 1C_4C ) )
  619.     PORT_DIPSETTING(      0x0003, DEF_STR( 1C_6C ) )
  620.     PORT_DIPNAME( 0x0038, 0x0038, DEF_STR( Coin_B ) )
  621.     PORT_DIPSETTING(      0x0000, DEF_STR( 4C_1C ) )
  622.     PORT_DIPSETTING(      0x0008, DEF_STR( 3C_1C ) )
  623.     PORT_DIPSETTING(      0x0010, DEF_STR( 2C_1C ) )
  624.     PORT_DIPSETTING(      0x0038, DEF_STR( 1C_1C ) )
  625.     PORT_DIPSETTING(      0x0030, DEF_STR( 1C_2C ) )
  626.     PORT_DIPSETTING(      0x0028, DEF_STR( 1C_3C ) )
  627.     PORT_DIPSETTING(      0x0020, DEF_STR( 1C_4C ) )
  628.     PORT_DIPSETTING(      0x0018, DEF_STR( 1C_6C ) )
  629.     PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
  630.     PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
  631.     PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Flip_Screen ) )
  632.     PORT_DIPSETTING(      0x0100, DEF_STR( Off ) )
  633.     PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
  634.     PORT_DIPNAME( 0x0200, 0x0200, "Attract music" )
  635.     PORT_DIPSETTING(      0x0200, DEF_STR( Off ) )
  636.     PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
  637.     PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
  638.     PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
  639.     PORT_DIPNAME( 0x1000, 0x1000, "Speed" )
  640.     PORT_DIPSETTING(      0x0000, "Slow" )
  641.     PORT_DIPSETTING(      0x1000, "Normal" )
  642.     PORT_DIPNAME( 0x2000, 0x2000, "Attract sound?" )
  643.     PORT_DIPSETTING(      0x2000, DEF_STR( Off ) )
  644.     PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
  645.     PORT_DIPNAME( 0x4000, 0x4000, "Freeze" )
  646.     PORT_DIPSETTING(      0x4000, DEF_STR( Off ) )
  647.     PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
  648.     PORT_SERVICE( 0x8000, IP_ACTIVE_LOW )
  649.  
  650.     PORT_START
  651.     PORT_DIPNAME( 0x0007, 0x0007, "Continuation max stage" )
  652.     PORT_DIPSETTING(      0x0007, "5th" )
  653.     PORT_DIPSETTING(      0x0006, "4th" )
  654.     PORT_DIPSETTING(      0x0005, "3rd" )
  655.     PORT_DIPSETTING(      0x0004, "2nd" )
  656.     PORT_DIPSETTING(      0x0003, "1st" )
  657.     PORT_DIPSETTING(      0x0002, "No continuation" )
  658.     PORT_DIPNAME( 0x0018, 0x0018, "Round time" )
  659.     PORT_DIPSETTING(      0x0018, "100" )
  660.     PORT_DIPSETTING(      0x0010, "150" )
  661.     PORT_DIPSETTING(      0x0008, "200" )
  662.     PORT_DIPSETTING(      0x0000, "250" )
  663.     PORT_DIPNAME( 0x0060, 0x0060, DEF_STR( Difficulty ) )
  664.     PORT_DIPSETTING(      0x0060, "Normal" )
  665.     PORT_DIPSETTING(      0x0040, "Easy" )
  666.     PORT_DIPSETTING(      0x0020, "Difficult" )
  667.     PORT_DIPSETTING(      0x0000, "Very difficult" )
  668.     PORT_DIPNAME( 0x0380, 0x0380, "Buy-in max stage" )
  669.     PORT_DIPSETTING(      0x0380, "5th" )
  670.     PORT_DIPSETTING(      0x0300, "4th" )
  671.     PORT_DIPSETTING(      0x0280, "3rd" )
  672.     PORT_DIPSETTING(      0x0200, "2nd" )
  673.     PORT_DIPSETTING(      0x0180, "1st" )
  674.     PORT_DIPSETTING(      0x0080, "No buy-in" )
  675.     PORT_DIPNAME( 0x0400, 0x0400, "Number of start countries" )
  676.     PORT_DIPSETTING(      0x0400, "4" )
  677.     PORT_DIPSETTING(      0x0000, "2" )
  678.     PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
  679.     PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
  680.     PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
  681.     PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
  682.     PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
  683.  
  684.     PORT_START
  685.     PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START1 )
  686.     PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_START2 )
  687.     PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN3 )
  688.     PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN )
  689.     PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
  690.     PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
  691.     PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
  692.     PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* Freezes the game ? */
  693.     PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )
  694.     PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
  695.     PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
  696.     PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
  697.     PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
  698.     PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
  699.     PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
  700.     PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
  701.  
  702.  
  703.     PORT_START
  704.     PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
  705.     PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
  706.     PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
  707.     PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN )
  708.     PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
  709.     PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
  710.     PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
  711.     PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
  712.     PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )
  713.     PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
  714.     PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
  715.     PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
  716.     PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
  717.     PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
  718.     PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
  719.     PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
  720.  
  721.     PORT_START
  722.     PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER1 )
  723.     PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER1 )
  724.     PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER1 )
  725.     PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER1 )
  726.     PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
  727.     PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
  728.     PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
  729.     PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
  730.     PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER2 )
  731.     PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER2 )
  732.     PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER2 )
  733.     PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER2 )
  734.     PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
  735.     PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
  736.     PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
  737.     PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
  738.  
  739.     PORT_START
  740.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_PLAYER1 )
  741.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 | IPF_PLAYER1 )
  742.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON3 | IPF_PLAYER1 )
  743.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  744.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  745.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  746.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  747.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  748.  
  749.     PORT_START
  750.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON4 | IPF_PLAYER1 )
  751.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON5 | IPF_PLAYER1 )
  752.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON6 | IPF_PLAYER1 )
  753.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  754.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  755.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  756.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  757.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  758.  
  759.     PORT_START
  760.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_PLAYER2 )
  761.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 | IPF_PLAYER2 )
  762.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON3 | IPF_PLAYER2 )
  763.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  764.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  765.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  766.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  767.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  768.  
  769.     PORT_START
  770.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON4 | IPF_PLAYER2 )
  771.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON5 | IPF_PLAYER2 )
  772.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON6 | IPF_PLAYER2 )
  773.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  774.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  775.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  776.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  777.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  778. INPUT_PORTS_END
  779.  
  780.  
  781.  
  782. static struct GfxLayout char_layout =
  783. {
  784.     8,8,
  785.     1024,
  786.     2,
  787.     { 4, 0 },
  788.     { 0, 1, 2, 3, 8+0, 8+1, 8+2, 8+3 },
  789.     { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16 },
  790.     16*8
  791. };
  792.  
  793. static struct GfxLayout sprite_layoutb =
  794. {
  795.     16,16,
  796.     4096,
  797.     4,
  798.     { 4, 0, 4096*64*8+4, 4096*64*8 },
  799.     { 0, 1, 2, 3, 8+0, 8+1, 8+2, 8+3,
  800.             16*16+0, 16*16+1, 16*16+2, 16*16+3, 16*16+8+0, 16*16+8+1, 16*16+8+2, 16*16+8+3 },
  801.     { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16,
  802.             8*16, 9*16, 10*16, 11*16, 12*16, 13*16, 14*16, 15*16 },
  803.     64*8
  804. };
  805.  
  806. static struct GfxLayout sprite_layoutm =
  807. {
  808.     16,16,
  809.     8192,
  810.     4,
  811.     { 4, 0, 8192*64*8+4, 8192*64*8 },
  812.     { 0, 1, 2, 3, 8+0, 8+1, 8+2, 8+3,
  813.             16*16+0, 16*16+1, 16*16+2, 16*16+3, 16*16+8+0, 16*16+8+1, 16*16+8+2, 16*16+8+3 },
  814.     { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16,
  815.             8*16, 9*16, 10*16, 11*16, 12*16, 13*16, 14*16, 15*16 },
  816.     64*8
  817. };
  818.  
  819. static struct GfxLayout sprite_layouts =
  820. {
  821.     16,16,
  822.     14336,
  823.     4,
  824.     { 4, 0, 14336*64*8+4, 14336*64*8 },
  825.     { 0, 1, 2, 3, 8+0, 8+1, 8+2, 8+3,
  826.             16*16+0, 16*16+1, 16*16+2, 16*16+3, 16*16+8+0, 16*16+8+1, 16*16+8+2, 16*16+8+3 },
  827.     { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16,
  828.             8*16, 9*16, 10*16, 11*16, 12*16, 13*16, 14*16, 15*16 },
  829.     64*8
  830. };
  831.  
  832.  
  833. static struct GfxDecodeInfo gfxdecodeinfo[] =
  834. {
  835.     { REGION_GFX1, 0, &sprite_layoutb,   0, 16 },
  836.     { REGION_GFX2, 0, &sprite_layoutm, 256, 16 },
  837.     { REGION_GFX3, 0, &sprite_layouts, 512, 16 },
  838.     { REGION_GFX4, 0, &char_layout,    768, 16 },
  839.     { -1 }
  840. };
  841.  
  842.  
  843.  
  844. static void irq_handler(int irq)
  845. {
  846.     cpu_set_irq_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE);
  847. }
  848.  
  849. static struct YM2151interface ym2151_interface =
  850. {
  851.     1,    /* 1 chip */
  852.     3579545,    /* ? xtal is 3.579545MHz */
  853.     { YM3012_VOL(60,MIXER_PAN_LEFT,60,MIXER_PAN_RIGHT) },
  854.     { irq_handler }
  855. };
  856.  
  857. static struct MSM5205interface msm5205_interface =
  858. {
  859.     2,        /* 2 chips */
  860.     384000,                /* 384KHz ?           */
  861.     { 0, 0 },/* interrupt function */
  862.     { MSM5205_SEX_4B,MSM5205_SEX_4B},    /* 8KHz playback ?    */
  863.     { 100, 100 }
  864. };
  865.  
  866. static struct MachineDriver machine_driver_sf1 =
  867. {
  868.     {
  869.         {
  870.             CPU_M68000,
  871.             8000000,    /* 8 MHz ? (xtal is 16MHz) */
  872.             readmem,writemem,0,0,
  873.             m68_level1_irq,1
  874.         },
  875.         {
  876.             CPU_Z80 | CPU_AUDIO_CPU,
  877.             3579545,    /* ? xtal is 3.579545MHz */
  878.             sound_readmem,sound_writemem,0,0,
  879.             ignore_interrupt,0    /* IRQs are caused by the YM2151 */
  880.                                 /* NMIs are caused by the main CPU */
  881.         },
  882.         {
  883.             CPU_Z80 | CPU_AUDIO_CPU,
  884.             3579545,    /* ? xtal is 3.579545MHz */
  885.             sound2_readmem, sound2_writemem,
  886.             sound2_readport, sound2_writeport,
  887.             0,0,
  888.             interrupt,8000
  889.         }
  890.     },
  891.     60, DEFAULT_60HZ_VBLANK_DURATION,    /* frames per second, vblank duration */
  892.     1,    /* 1 CPU slice per frame - interleaving is forced when a sound command is written */
  893.     0,
  894.  
  895.     /* video hardware */
  896.     64*8, 32*8, { 8*8, (64-8)*8-1, 2*8, 30*8-1 },
  897.     gfxdecodeinfo,
  898.     1024, 1024,
  899.     0,
  900.  
  901.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE,
  902.     0,
  903.     sf1_vh_start,
  904.     0,
  905.     sf1_vh_screenrefresh,
  906.  
  907.     /* sound hardware */
  908.     SOUND_SUPPORTS_STEREO,0,0,0,
  909.     {
  910.         {
  911.             SOUND_YM2151,
  912.             &ym2151_interface
  913.         },
  914.         {
  915.             SOUND_MSM5205,
  916.             &msm5205_interface
  917.         }
  918.     }
  919. };
  920.  
  921. static struct MachineDriver machine_driver_sf1us =
  922. {
  923.     {
  924.         {
  925.             CPU_M68000,
  926.             8000000,    /* 8 MHz ? (xtal is 16MHz) */
  927.             readmemus,writemem,0,0,
  928.             m68_level1_irq,1
  929.         },
  930.         {
  931.             CPU_Z80 | CPU_AUDIO_CPU,
  932.             3579545,    /* ? xtal is 3.579545MHz */
  933.             sound_readmem,sound_writemem,0,0,
  934.             ignore_interrupt,0    /* IRQs are caused by the YM2151 */
  935.                                 /* NMIs are caused by the main CPU */
  936.         },
  937.         {
  938.             CPU_Z80 | CPU_AUDIO_CPU,
  939.             3579545,    /* ? xtal is 3.579545MHz */
  940.             sound2_readmem, sound2_writemem,
  941.             sound2_readport, sound2_writeport,
  942.             0,0,
  943.             interrupt,8000
  944.         }
  945.     },
  946.     60, DEFAULT_60HZ_VBLANK_DURATION,    /* frames per second, vblank duration */
  947.     1,    /* 1 CPU slice per frame - interleaving is forced when a sound command is written */
  948.     0,
  949.  
  950.     /* video hardware */
  951.     64*8, 32*8, { 8*8, (64-8)*8-1, 2*8, 30*8-1 },
  952.     gfxdecodeinfo,
  953.     1024, 1024,
  954.     0,
  955.  
  956.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE,
  957.     0,
  958.     sf1_vh_start,
  959.     0,
  960.     sf1_vh_screenrefresh,
  961.  
  962.     /* sound hardware */
  963.     SOUND_SUPPORTS_STEREO,0,0,0,
  964.     {
  965.         {
  966.             SOUND_YM2151,
  967.             &ym2151_interface
  968.         },
  969.         {
  970.             SOUND_MSM5205,
  971.             &msm5205_interface
  972.         }
  973.     }
  974. };
  975.  
  976. static struct MachineDriver machine_driver_sf1jp =
  977. {
  978.     {
  979.         {
  980.             CPU_M68000,
  981.             8000000,    /* 8 MHz ? (xtal is 16MHz) */
  982.             readmemjp,writemem,0,0,
  983.             m68_level1_irq,1
  984.         },
  985.         {
  986.             CPU_Z80 | CPU_AUDIO_CPU,
  987.             3579545,    /* ? xtal is 3.579545MHz */
  988.             sound_readmem,sound_writemem,0,0,
  989.             ignore_interrupt,0    /* IRQs are caused by the YM2151 */
  990.                                 /* NMIs are caused by the main CPU */
  991.         },
  992.         {
  993.             CPU_Z80 | CPU_AUDIO_CPU,
  994.             3579545,    /* ? xtal is 3.579545MHz */
  995.             sound2_readmem, sound2_writemem,
  996.             sound2_readport, sound2_writeport,
  997.             0,0,
  998.             interrupt,8000
  999.         }
  1000.     },
  1001.     60, DEFAULT_60HZ_VBLANK_DURATION,    /* frames per second, vblank duration */
  1002.     1,    /* 1 CPU slice per frame - interleaving is forced when a sound command is written */
  1003.     0,
  1004.  
  1005.     /* video hardware */
  1006.     64*8, 32*8, { 8*8, (64-8)*8-1, 2*8, 30*8-1 },
  1007.     gfxdecodeinfo,
  1008.     1024, 1024,
  1009.     0,
  1010.  
  1011.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE,
  1012.     0,
  1013.     sf1_vh_start,
  1014.     0,
  1015.     sf1_vh_screenrefresh,
  1016.  
  1017.     /* sound hardware */
  1018.     SOUND_SUPPORTS_STEREO,0,0,0,
  1019.     {
  1020.         {
  1021.             SOUND_YM2151,
  1022.             &ym2151_interface
  1023.         },
  1024.         {
  1025.             SOUND_MSM5205,
  1026.             &msm5205_interface
  1027.         }
  1028.     }
  1029. };
  1030.  
  1031.  
  1032. ROM_START( sf1 )
  1033.     ROM_REGION( 0x60000, REGION_CPU1 )
  1034.     ROM_LOAD_EVEN("sfe-19", 0x00000, 0x10000, 0x8346c3ca )
  1035.     ROM_LOAD_ODD ("sfe-22", 0x00000, 0x10000, 0x3a4bfaa8 )
  1036.     ROM_LOAD_EVEN("sfe-20", 0x20000, 0x10000, 0xb40e67ee )
  1037.     ROM_LOAD_ODD ("sfe-23", 0x20000, 0x10000, 0x477c3d5b )
  1038.     ROM_LOAD_EVEN("sfe-21", 0x40000, 0x10000, 0x2547192b )
  1039.     ROM_LOAD_ODD ("sfe-24", 0x40000, 0x10000, 0x79680f4e )
  1040.  
  1041.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the music CPU */
  1042.     ROM_LOAD( "sf-02.bin", 0x0000, 0x8000, 0x4a9ac534 )
  1043.  
  1044.     ROM_REGION( 0x40000, REGION_CPU3 )    /* 256k for the samples CPU */
  1045.     ROM_LOAD( "sfu-00",    0x00000, 0x20000, 0xa7cce903 )
  1046.     ROM_LOAD( "sf-01.bin", 0x20000, 0x20000, 0x86e0f0d5 )
  1047.  
  1048.     ROM_REGION( 0x080000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  1049.     ROM_LOAD( "sf-39.bin", 0x000000, 0x020000, 0xcee3d292 ) /* Background b planes 0-1*/
  1050.     ROM_LOAD( "sf-38.bin", 0x020000, 0x020000, 0x2ea99676 )
  1051.     ROM_LOAD( "sf-41.bin", 0x040000, 0x020000, 0xe0280495 ) /* planes 2-3 */
  1052.     ROM_LOAD( "sf-40.bin", 0x060000, 0x020000, 0xc70b30de )
  1053.  
  1054.     ROM_REGION( 0x100000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  1055.     ROM_LOAD( "sf-25.bin", 0x000000, 0x020000, 0x7f23042e )    /* Background m planes 0-1 */
  1056.     ROM_LOAD( "sf-28.bin", 0x020000, 0x020000, 0x92f8b91c )
  1057.     ROM_LOAD( "sf-30.bin", 0x040000, 0x020000, 0xb1399856 )
  1058.     ROM_LOAD( "sf-34.bin", 0x060000, 0x020000, 0x96b6ae2e )
  1059.     ROM_LOAD( "sf-26.bin", 0x080000, 0x020000, 0x54ede9f5 ) /* planes 2-3 */
  1060.     ROM_LOAD( "sf-29.bin", 0x0a0000, 0x020000, 0xf0649a67 )
  1061.     ROM_LOAD( "sf-31.bin", 0x0c0000, 0x020000, 0x8f4dd71a )
  1062.     ROM_LOAD( "sf-35.bin", 0x0e0000, 0x020000, 0x70c00fb4 )
  1063.  
  1064.     ROM_REGION( 0x1c0000, REGION_GFX3 | REGIONFLAG_DISPOSE )
  1065.     ROM_LOAD( "sf-15.bin", 0x000000, 0x020000, 0xfc0113db ) /* Sprites planes 1-2 */
  1066.     ROM_LOAD( "sf-16.bin", 0x020000, 0x020000, 0x82e4a6d3 )
  1067.     ROM_LOAD( "sf-11.bin", 0x040000, 0x020000, 0xe112df1b )
  1068.     ROM_LOAD( "sf-12.bin", 0x060000, 0x020000, 0x42d52299 )
  1069.     ROM_LOAD( "sf-07.bin", 0x080000, 0x020000, 0x49f340d9 )
  1070.     ROM_LOAD( "sf-08.bin", 0x0a0000, 0x020000, 0x95ece9b1 )
  1071.     ROM_LOAD( "sf-03.bin", 0x0c0000, 0x020000, 0x5ca05781 )
  1072.     ROM_LOAD( "sf-17.bin", 0x0e0000, 0x020000, 0x69fac48e ) /* planes 2-3 */
  1073.     ROM_LOAD( "sf-18.bin", 0x100000, 0x020000, 0x71cfd18d )
  1074.     ROM_LOAD( "sf-13.bin", 0x120000, 0x020000, 0xfa2eb24b )
  1075.     ROM_LOAD( "sf-14.bin", 0x140000, 0x020000, 0xad955c95 )
  1076.     ROM_LOAD( "sf-09.bin", 0x160000, 0x020000, 0x41b73a31 )
  1077.     ROM_LOAD( "sf-10.bin", 0x180000, 0x020000, 0x91c41c50 )
  1078.     ROM_LOAD( "sf-05.bin", 0x1a0000, 0x020000, 0x538c7cbe )
  1079.  
  1080.     ROM_REGION( 0x004000, REGION_GFX4 | REGIONFLAG_DISPOSE )
  1081.     ROM_LOAD( "sf-27.bin", 0x000000, 0x004000, 0x2b09b36d ) /* Characters planes 1-2 */
  1082.  
  1083.     ROM_REGION( 0x40000, REGION_GFX5 )    /* background tilemaps */
  1084.     ROM_LOAD( "sf-37.bin", 0x000000, 0x010000, 0x23d09d3d )
  1085.     ROM_LOAD( "sf-36.bin", 0x010000, 0x010000, 0xea16df6c )
  1086.     ROM_LOAD( "sf-32.bin", 0x020000, 0x010000, 0x72df2bd9 )
  1087.     ROM_LOAD( "sf-33.bin", 0x030000, 0x010000, 0x3e99d3d5 )
  1088. ROM_END
  1089.  
  1090. ROM_START( sf1us )
  1091.     ROM_REGION( 0x60000, REGION_CPU1 )
  1092.     ROM_LOAD_EVEN("sfd-19", 0x00000, 0x10000, 0xfaaf6255 )
  1093.     ROM_LOAD_ODD ("sfd-22", 0x00000, 0x10000, 0xe1fe3519 )
  1094.     ROM_LOAD_EVEN("sfd-20", 0x20000, 0x10000, 0x44b915bd )
  1095.     ROM_LOAD_ODD ("sfd-23", 0x20000, 0x10000, 0x79c43ff8 )
  1096.     ROM_LOAD_EVEN("sfd-21", 0x40000, 0x10000, 0xe8db799b )
  1097.     ROM_LOAD_ODD ("sfd-24", 0x40000, 0x10000, 0x466a3440 )
  1098.  
  1099.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the music CPU */
  1100.     ROM_LOAD( "sf-02.bin", 0x0000, 0x8000, 0x4a9ac534 )
  1101.  
  1102.     ROM_REGION( 0x40000, REGION_CPU3 )    /* 256k for the samples CPU */
  1103.     ROM_LOAD( "sfu-00",    0x00000, 0x20000, 0xa7cce903 )
  1104.     ROM_LOAD( "sf-01.bin", 0x20000, 0x20000, 0x86e0f0d5 )
  1105.  
  1106.     ROM_REGION( 0x080000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  1107.     ROM_LOAD( "sf-39.bin", 0x000000, 0x020000, 0xcee3d292 ) /* Background b planes 0-1*/
  1108.     ROM_LOAD( "sf-38.bin", 0x020000, 0x020000, 0x2ea99676 )
  1109.     ROM_LOAD( "sf-41.bin", 0x040000, 0x020000, 0xe0280495 ) /* planes 2-3 */
  1110.     ROM_LOAD( "sf-40.bin", 0x060000, 0x020000, 0xc70b30de )
  1111.  
  1112.     ROM_REGION( 0x100000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  1113.     ROM_LOAD( "sf-25.bin", 0x000000, 0x020000, 0x7f23042e )    /* Background m planes 0-1 */
  1114.     ROM_LOAD( "sf-28.bin", 0x020000, 0x020000, 0x92f8b91c )
  1115.     ROM_LOAD( "sf-30.bin", 0x040000, 0x020000, 0xb1399856 )
  1116.     ROM_LOAD( "sf-34.bin", 0x060000, 0x020000, 0x96b6ae2e )
  1117.     ROM_LOAD( "sf-26.bin", 0x080000, 0x020000, 0x54ede9f5 ) /* planes 2-3 */
  1118.     ROM_LOAD( "sf-29.bin", 0x0a0000, 0x020000, 0xf0649a67 )
  1119.     ROM_LOAD( "sf-31.bin", 0x0c0000, 0x020000, 0x8f4dd71a )
  1120.     ROM_LOAD( "sf-35.bin", 0x0e0000, 0x020000, 0x70c00fb4 )
  1121.  
  1122.     ROM_REGION( 0x1c0000, REGION_GFX3 | REGIONFLAG_DISPOSE )
  1123.     ROM_LOAD( "sf-15.bin", 0x000000, 0x020000, 0xfc0113db ) /* Sprites planes 1-2 */
  1124.     ROM_LOAD( "sf-16.bin", 0x020000, 0x020000, 0x82e4a6d3 )
  1125.     ROM_LOAD( "sf-11.bin", 0x040000, 0x020000, 0xe112df1b )
  1126.     ROM_LOAD( "sf-12.bin", 0x060000, 0x020000, 0x42d52299 )
  1127.     ROM_LOAD( "sf-07.bin", 0x080000, 0x020000, 0x49f340d9 )
  1128.     ROM_LOAD( "sf-08.bin", 0x0a0000, 0x020000, 0x95ece9b1 )
  1129.     ROM_LOAD( "sf-03.bin", 0x0c0000, 0x020000, 0x5ca05781 )
  1130.     ROM_LOAD( "sf-17.bin", 0x0e0000, 0x020000, 0x69fac48e ) /* planes 2-3 */
  1131.     ROM_LOAD( "sf-18.bin", 0x100000, 0x020000, 0x71cfd18d )
  1132.     ROM_LOAD( "sf-13.bin", 0x120000, 0x020000, 0xfa2eb24b )
  1133.     ROM_LOAD( "sf-14.bin", 0x140000, 0x020000, 0xad955c95 )
  1134.     ROM_LOAD( "sf-09.bin", 0x160000, 0x020000, 0x41b73a31 )
  1135.     ROM_LOAD( "sf-10.bin", 0x180000, 0x020000, 0x91c41c50 )
  1136.     ROM_LOAD( "sf-05.bin", 0x1a0000, 0x020000, 0x538c7cbe )
  1137.  
  1138.     ROM_REGION( 0x004000, REGION_GFX4 | REGIONFLAG_DISPOSE )
  1139.     ROM_LOAD( "sf-27.bin", 0x000000, 0x004000, 0x2b09b36d ) /* Characters planes 1-2 */
  1140.  
  1141.     ROM_REGION( 0x40000, REGION_GFX5 )    /* background tilemaps */
  1142.     ROM_LOAD( "sf-37.bin", 0x000000, 0x010000, 0x23d09d3d )
  1143.     ROM_LOAD( "sf-36.bin", 0x010000, 0x010000, 0xea16df6c )
  1144.     ROM_LOAD( "sf-32.bin", 0x020000, 0x010000, 0x72df2bd9 )
  1145.     ROM_LOAD( "sf-33.bin", 0x030000, 0x010000, 0x3e99d3d5 )
  1146. ROM_END
  1147.  
  1148. ROM_START( sf1jp )
  1149.     ROM_REGION( 0x60000, REGION_CPU1 )
  1150.     ROM_LOAD_EVEN("sf-19.bin", 0x00000, 0x10000, 0x116027d7 )
  1151.     ROM_LOAD_ODD ("sf-22.bin", 0x00000, 0x10000, 0xd3cbd09e )
  1152.     ROM_LOAD_EVEN("sf-20.bin", 0x20000, 0x10000, 0xfe07e83f )
  1153.     ROM_LOAD_ODD ("sf-23.bin", 0x20000, 0x10000, 0x1e435d33 )
  1154.     ROM_LOAD_EVEN("sf-21.bin", 0x40000, 0x10000, 0xe086bc4c )
  1155.     ROM_LOAD_ODD ("sf-24.bin", 0x40000, 0x10000, 0x13a6696b )
  1156.  
  1157.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the music CPU */
  1158.     ROM_LOAD( "sf-02.bin", 0x0000, 0x8000, 0x4a9ac534 )
  1159.  
  1160.     ROM_REGION( 0x40000, REGION_CPU3 )    /* 256k for the samples CPU */
  1161.     ROM_LOAD( "sf-00.bin", 0x00000, 0x20000, 0x4b733845 )
  1162.     ROM_LOAD( "sf-01.bin", 0x20000, 0x20000, 0x86e0f0d5 )
  1163.  
  1164.     ROM_REGION( 0x080000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  1165.     ROM_LOAD( "sf-39.bin", 0x000000, 0x020000, 0xcee3d292 ) /* Background b planes 0-1*/
  1166.     ROM_LOAD( "sf-38.bin", 0x020000, 0x020000, 0x2ea99676 )
  1167.     ROM_LOAD( "sf-41.bin", 0x040000, 0x020000, 0xe0280495 ) /* planes 2-3 */
  1168.     ROM_LOAD( "sf-40.bin", 0x060000, 0x020000, 0xc70b30de )
  1169.  
  1170.     ROM_REGION( 0x100000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  1171.     ROM_LOAD( "sf-25.bin", 0x000000, 0x020000, 0x7f23042e )    /* Background m planes 0-1 */
  1172.     ROM_LOAD( "sf-28.bin", 0x020000, 0x020000, 0x92f8b91c )
  1173.     ROM_LOAD( "sf-30.bin", 0x040000, 0x020000, 0xb1399856 )
  1174.     ROM_LOAD( "sf-34.bin", 0x060000, 0x020000, 0x96b6ae2e )
  1175.     ROM_LOAD( "sf-26.bin", 0x080000, 0x020000, 0x54ede9f5 ) /* planes 2-3 */
  1176.     ROM_LOAD( "sf-29.bin", 0x0a0000, 0x020000, 0xf0649a67 )
  1177.     ROM_LOAD( "sf-31.bin", 0x0c0000, 0x020000, 0x8f4dd71a )
  1178.     ROM_LOAD( "sf-35.bin", 0x0e0000, 0x020000, 0x70c00fb4 )
  1179.  
  1180.     ROM_REGION( 0x1c0000, REGION_GFX3 | REGIONFLAG_DISPOSE )
  1181.     ROM_LOAD( "sf-15.bin", 0x000000, 0x020000, 0xfc0113db ) /* Sprites planes 1-2 */
  1182.     ROM_LOAD( "sf-16.bin", 0x020000, 0x020000, 0x82e4a6d3 )
  1183.     ROM_LOAD( "sf-11.bin", 0x040000, 0x020000, 0xe112df1b )
  1184.     ROM_LOAD( "sf-12.bin", 0x060000, 0x020000, 0x42d52299 )
  1185.     ROM_LOAD( "sf-07.bin", 0x080000, 0x020000, 0x49f340d9 )
  1186.     ROM_LOAD( "sf-08.bin", 0x0a0000, 0x020000, 0x95ece9b1 )
  1187.     ROM_LOAD( "sf-03.bin", 0x0c0000, 0x020000, 0x5ca05781 )
  1188.     ROM_LOAD( "sf-17.bin", 0x0e0000, 0x020000, 0x69fac48e ) /* planes 2-3 */
  1189.     ROM_LOAD( "sf-18.bin", 0x100000, 0x020000, 0x71cfd18d )
  1190.     ROM_LOAD( "sf-13.bin", 0x120000, 0x020000, 0xfa2eb24b )
  1191.     ROM_LOAD( "sf-14.bin", 0x140000, 0x020000, 0xad955c95 )
  1192.     ROM_LOAD( "sf-09.bin", 0x160000, 0x020000, 0x41b73a31 )
  1193.     ROM_LOAD( "sf-10.bin", 0x180000, 0x020000, 0x91c41c50 )
  1194.     ROM_LOAD( "sf-05.bin", 0x1a0000, 0x020000, 0x538c7cbe )
  1195.  
  1196.     ROM_REGION( 0x004000, REGION_GFX4 | REGIONFLAG_DISPOSE )
  1197.     ROM_LOAD( "sf-27.bin", 0x000000, 0x004000, 0x2b09b36d ) /* Characters planes 1-2 */
  1198.  
  1199.     ROM_REGION( 0x40000, REGION_GFX5 )    /* background tilemaps */
  1200.     ROM_LOAD( "sf-37.bin", 0x000000, 0x010000, 0x23d09d3d )
  1201.     ROM_LOAD( "sf-36.bin", 0x010000, 0x010000, 0xea16df6c )
  1202.     ROM_LOAD( "sf-32.bin", 0x020000, 0x010000, 0x72df2bd9 )
  1203.     ROM_LOAD( "sf-33.bin", 0x030000, 0x010000, 0x3e99d3d5 )
  1204. ROM_END
  1205.  
  1206.  
  1207.  
  1208. GAME( 1987, sf1,   0,   sf1,   sf1,   0, ROT0, "Capcom", "Street Fighter (World)" )
  1209. GAME( 1987, sf1us, sf1, sf1us, sf1us, 0, ROT0, "Capcom", "Street Fighter (US)" )
  1210. GAME( 1987, sf1jp, sf1, sf1jp, sf1jp, 0, ROT0, "Capcom", "Street Fighter (Japan)" )
  1211.